package com.dlry.db;

import java.util.List;

import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.dlry.entity.DlBranch;

public interface BranchRepository extends JpaRepository<DlBranch, Long> {

	Page<DlBranch> findAll(Pageable arg0);

	long count();

	void delete(DlBranch arg0);

	void delete(Iterable<? extends DlBranch> arg0);

	void delete(Long arg0);

	void deleteAll();

	boolean exists(Long arg0);

	DlBranch findOne(Long arg0);

	<S extends DlBranch> S save(S arg0);

	<S extends DlBranch> long count(Example<S> arg0);

	<S extends DlBranch> boolean exists(Example<S> arg0);

	<S extends DlBranch> Page<S> findAll(Example<S> arg0, Pageable arg1);

	<S extends DlBranch> S findOne(Example<S> arg0);

	List<DlBranch> findAll();

	List<DlBranch> findAll(Sort sort);

	List<DlBranch> findAll(Iterable<Long> ids);

	<S extends DlBranch> List<S> save(Iterable<S> entities);

	void flush();

	<S extends DlBranch> S saveAndFlush(S entity);

	<S extends DlBranch> List<S> findAll(Example<S> example);

	<S extends DlBranch> List<S> findAll(Example<S> example, Sort sort);

	@Query("select b from DlBranch b where b.name = ?1")
	DlBranch findOneByName(String name);

	@Query("select b.name from DlBranch b")
	List<String> findAllName();
}
